#include "SceneNode.h"

SceneNode::SceneNode(void)
{
}

SceneNode::SceneNode(const SceneNode &rhs)
{
	lChildren = rhs.lChildren;
}
SceneNode& SceneNode::operator =(const SceneNode& rhs)
{
	lChildren = rhs.lChildren;
	return *this;
}
SceneNode::~SceneNode(void)
{
	Destroy();
}
void SceneNode::Destroy()
{
	for( std::list<SceneNode*>::const_iterator i = lChildren.begin(); i != lChildren.end(); i++ )
      (*i)->Destroy();
    lChildren.clear();
}

void SceneNode::Update(VertBuffer* pvBuff)
{
	for( std::list<SceneNode*>::const_iterator i = lChildren.begin(); i != lChildren.end(); i++ )
		(*i)->Update(pvBuff);
}
void SceneNode::AddChild(SceneNode* pChild)
{
	lChildren.push_back(pChild);
}

void SceneNode::Release()
{
	delete this;
}